package leetcode.code0998;

import leetcode.helper.tree.TreeNode;

public class Solution {
	public TreeNode insertIntoMaxTree(TreeNode root, int val) {
		if (root == null) {
			TreeNode node = new TreeNode(val);
			return node;
		}
		if (val > root.val) {
			TreeNode node = new TreeNode(val);
			node.left = root;
			return node;
		}
		root.right = this.insertIntoMaxTree(root.right, val);
		return root;
	}
}
